<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>数组的创建方式</title>
    </head>
    <body>

        <script type="text/javascript">

            //创建数组
            var arr1  = new Array();
            var arr2 = [];

            var arr3 = new Array(5);

            var arr4 = ["元素1","元素2"];

            console.log(arr1.length);
            console.log(arr2.length);
            console.log(arr3.length);
            console.log(arr4.length);

        </script>

    </body>
</html>